# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'settings.ui'
#
# Created: Sun Aug 10 20:52:56 2008
#      by: PyQt4 UI code generator 4.4.2
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
import userPref

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(503,488)
        Dialog.setMinimumSize(QtCore.QSize(0,0))
        Dialog.setMaximumSize(QtCore.QSize(16000,16000))
        #self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        #self.buttonBox.setGeometry(QtCore.QRect(20,450,461,32))
        #self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        #self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        #self.buttonBox.setObjectName("buttonBox")
        self.label = QtGui.QLabel(Dialog)
        self.label.setGeometry(QtCore.QRect(10,10,141,16))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setWeight(75)
        font.setBold(True)
        self.label.setFont(font)
        self.label.setObjectName("label")
        self.groupBox_2 = QtGui.QGroupBox(Dialog)
        self.groupBox_2.setGeometry(QtCore.QRect(30,320,451,121))
        self.groupBox_2.setObjectName("groupBox_2")
        self.label_2 = QtGui.QLabel(self.groupBox_2)
        self.label_2.setGeometry(QtCore.QRect(30,40,101,16))
        self.label_2.setObjectName("label_2")
        self.label_6 = QtGui.QLabel(self.groupBox_2)
        self.label_6.setGeometry(QtCore.QRect(30,80,161,16))
        self.label_6.setObjectName("label_6")
        self.label_13 = QtGui.QLabel(self.groupBox_2)
        self.label_13.setGeometry(QtCore.QRect(208,40,185,16))
        self.label_13.setObjectName("label_13")
        self.pushButton_2 = QtGui.QPushButton(self.groupBox_2)
        self.pushButton_2.setGeometry(QtCore.QRect(420,20,21,21))
        self.pushButton_2.setObjectName("pushButton_2")
        self.horizontalSlider_5 = QtGui.QSlider(self.groupBox_2)
        self.horizontalSlider_5.setGeometry(QtCore.QRect(230,80,91,21))
        self.horizontalSlider_5.setMaximum(1)
        self.horizontalSlider_5.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_5.setObjectName("horizontalSlider_5")
        self.label_17 = QtGui.QLabel(self.groupBox_2)
        self.label_17.setGeometry(QtCore.QRect(340,80,71,16))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_17.setFont(font)
        self.label_17.setObjectName("label_17")
        self.label_18 = QtGui.QLabel(self.groupBox_2)
        self.label_18.setGeometry(QtCore.QRect(170,80,46,14))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_18.setFont(font)
        self.label_18.setObjectName("label_18")
        #self.comboBox = QtGui.QComboBox(self.groupBox_2)
        #self.comboBox.setGeometry(QtCore.QRect(170,40,69,22))
        #self.comboBox.setObjectName("comboBox")
        self.lineEdit = QtGui.QLineEdit(self.groupBox_2)
        self.lineEdit.setGeometry(QtCore.QRect(100,40,101,20))
        self.lineEdit.setMaxLength(4)
        self.lineEdit.setFrame(True)
        self.lineEdit.setObjectName("lineEdit")

        self.groupBox = QtGui.QGroupBox(Dialog)
        self.groupBox.setGeometry(QtCore.QRect(30,170,451,141))
        self.groupBox.setObjectName("groupBox")
        self.horizontalSlider_3 = QtGui.QSlider(self.groupBox)
        self.horizontalSlider_3.setGeometry(QtCore.QRect(160,110,91,21))
        self.horizontalSlider_3.setMaximum(1)
        self.horizontalSlider_3.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_3.setObjectName("horizontalSlider_3")
        self.label_5 = QtGui.QLabel(self.groupBox)
        self.label_5.setGeometry(QtCore.QRect(30,110,91,16))
        self.label_5.setObjectName("label_5")
        self.label_4 = QtGui.QLabel(self.groupBox)
        self.label_4.setGeometry(QtCore.QRect(30,70,91,16))
        self.label_4.setObjectName("label_4")
        self.label_7 = QtGui.QLabel(self.groupBox)
        self.label_7.setGeometry(QtCore.QRect(130,30,46,14))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_7.setFont(font)
        self.label_7.setObjectName("label_7")
        self.horizontalSlider = QtGui.QSlider(self.groupBox)
        self.horizontalSlider.setGeometry(QtCore.QRect(160,30,91,21))
        self.horizontalSlider.setMaximum(1)
        self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider.setObjectName("horizontalSlider")
        self.horizontalSlider_2 = QtGui.QSlider(self.groupBox)
        self.horizontalSlider_2.setGeometry(QtCore.QRect(160,70,91,21))
        self.horizontalSlider_2.setMaximum(1)
        self.horizontalSlider_2.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_2.setObjectName("horizontalSlider_2")
        self.label_10 = QtGui.QLabel(self.groupBox)
        self.label_10.setGeometry(QtCore.QRect(260,70,46,14))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_10.setFont(font)
        self.label_10.setObjectName("label_10")
        self.label_3 = QtGui.QLabel(self.groupBox)
        self.label_3.setGeometry(QtCore.QRect(30,30,101,16))
        self.label_3.setObjectName("label_3")
        self.label_9 = QtGui.QLabel(self.groupBox)
        self.label_9.setGeometry(QtCore.QRect(130,70,46,14))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_9.setFont(font)
        self.label_9.setObjectName("label_9")
        self.label_12 = QtGui.QLabel(self.groupBox)
        self.label_12.setGeometry(QtCore.QRect(260,110,46,14))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_12.setFont(font)
        self.label_12.setObjectName("label_12")
        self.label_8 = QtGui.QLabel(self.groupBox)
        self.label_8.setGeometry(QtCore.QRect(260,30,46,14))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_8.setFont(font)
        self.label_8.setObjectName("label_8")
        self.label_11 = QtGui.QLabel(self.groupBox)
        self.label_11.setGeometry(QtCore.QRect(130,110,46,14))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_11.setFont(font)
        self.label_11.setObjectName("label_11")
        self.pushButton = QtGui.QPushButton(self.groupBox)
        self.pushButton.setGeometry(QtCore.QRect(420,20,21,21))
        self.pushButton.setObjectName("pushButton")
        self.groupBox_3 = QtGui.QGroupBox(Dialog)
        self.groupBox_3.setGeometry(QtCore.QRect(30,100,451,61))
        self.groupBox_3.setObjectName("groupBox_3")
        self.pushButton_3 = QtGui.QPushButton(self.groupBox_3)
        self.pushButton_3.setGeometry(QtCore.QRect(420,20,21,21))
        self.pushButton_3.setObjectName("pushButton_3")
        self.label_14 = QtGui.QLabel(self.groupBox_3)
        self.label_14.setGeometry(QtCore.QRect(30,30,251,16))
        self.label_14.setObjectName("label_14")
        self.label_16 = QtGui.QLabel(self.groupBox_3)
        self.label_16.setGeometry(QtCore.QRect(250,30,46,14))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_16.setFont(font)
        self.label_16.setObjectName("label_16")
        self.label_15 = QtGui.QLabel(self.groupBox_3)
        self.label_15.setGeometry(QtCore.QRect(380,30,46,14))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setWeight(75)
        font.setBold(True)
        self.label_15.setFont(font)
        self.label_15.setObjectName("label_15")
        self.horizontalSlider_4 = QtGui.QSlider(self.groupBox_3)
        self.horizontalSlider_4.setGeometry(QtCore.QRect(280,30,91,21))
        self.horizontalSlider_4.setMaximum(1)
        self.horizontalSlider_4.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_4.setObjectName("horizontalSlider_4")
        self.groupBox_4 = QtGui.QGroupBox(Dialog)
        self.groupBox_4.setGeometry(QtCore.QRect(30,30,451,61))
        self.groupBox_4.setObjectName("groupBox_4")
        self.label_20 = QtGui.QLabel(self.groupBox_4)
        self.label_20.setGeometry(QtCore.QRect(270,30,81,16))
        self.label_20.setObjectName("label_20")
        self.label_19 = QtGui.QLabel(self.groupBox_4)
        self.label_19.setGeometry(QtCore.QRect(20,30,111,16))
        self.label_19.setObjectName("label_19")
        
        
        self.lineEdit1 = QtGui.QLineEdit(self.groupBox_4)
        self.lineEdit1.setGeometry(QtCore.QRect(130,20,118,22))
        self.lineEdit1.setMaxLength(4)
        self.lineEdit1.setFrame(True)
        self.lineEdit1.setObjectName("lineEdit1")
        
      #  self.timeEdit = QtGui.QTimeEdit(self.groupBox_4)
      #  self.timeEdit.setGeometry(QtCore.QRect(130,20,118,22))
        #self.timeEdit.setMinimumTime(QtCore.QTime(0,5,0))
      #  self.timeEdit.setObjectName("timeEdit")

        self.pushButton_4 = QtGui.QPushButton(Dialog)
        self.pushButton_4.setGeometry(QtCore.QRect(330,450,75,23))
        self.pushButton_4.setObjectName("pushButton_4")
        self.pushButton_5 = QtGui.QPushButton(Dialog)
        self.pushButton_5.setGeometry(QtCore.QRect(410,450,75,23))
        self.pushButton_5.setObjectName("pushButton_5")


        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("Dialog", "Settings:", None, QtGui.QApplication.UnicodeUTF8))
        self.groupBox_2.setTitle(QtGui.QApplication.translate("Dialog", "Space Management", None, QtGui.QApplication.UnicodeUTF8))
        self.label_2.setText(QtGui.QApplication.translate("Dialog", "Threshold : ", None, QtGui.QApplication.UnicodeUTF8))
        self.label_6.setText(QtGui.QApplication.translate("Dialog", "Space cleaning routine:", None, QtGui.QApplication.UnicodeUTF8))
        self.label_13.setText(QtGui.QApplication.translate("Dialog", "MBytes of Free space available on disk", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton_2.setText(QtGui.QApplication.translate("Dialog", "?", None, QtGui.QApplication.UnicodeUTF8))
        self.label_17.setText(QtGui.QApplication.translate("Dialog", "Auto", None, QtGui.QApplication.UnicodeUTF8))
        self.label_18.setText(QtGui.QApplication.translate("Dialog", "Manual", None, QtGui.QApplication.UnicodeUTF8))
        #self.comboBox.addItem(QtGui.QApplication.translate("Dialog", "10", None, QtGui.QApplication.UnicodeUTF8))
        #self.comboBox.addItem(QtGui.QApplication.translate("Dialog", "15", None, QtGui.QApplication.UnicodeUTF8))
        #self.comboBox.addItem(QtGui.QApplication.translate("Dialog", "20", None, QtGui.QApplication.UnicodeUTF8))
        #self.comboBox.addItem(QtGui.QApplication.translate("Dialog", "25", None, QtGui.QApplication.UnicodeUTF8))
        #self.comboBox.addItem(QtGui.QApplication.translate("Dialog", "30", None, QtGui.QApplication.UnicodeUTF8))
        #self.comboBox.addItem(QtGui.QApplication.translate("Dialog", "35", None, QtGui.QApplication.UnicodeUTF8))
        #self.comboBox.addItem(QtGui.QApplication.translate("Dialog", "40", None, QtGui.QApplication.UnicodeUTF8))
        #self.comboBox.addItem(QtGui.QApplication.translate("Dialog", "45", None, QtGui.QApplication.UnicodeUTF8))
        #self.comboBox.addItem(QtGui.QApplication.translate("Dialog", "50", None, QtGui.QApplication.UnicodeUTF8))
        self.groupBox.setTitle(QtGui.QApplication.translate("Dialog", "Cleanup Routines", None, QtGui.QApplication.UnicodeUTF8))
        self.label_5.setText(QtGui.QApplication.translate("Dialog", "Daily Cleanup :", None, QtGui.QApplication.UnicodeUTF8))
        self.label_4.setText(QtGui.QApplication.translate("Dialog", "Weekly Cleanup :", None, QtGui.QApplication.UnicodeUTF8))
        self.label_7.setText(QtGui.QApplication.translate("Dialog", "OFF", None, QtGui.QApplication.UnicodeUTF8))
        self.label_10.setText(QtGui.QApplication.translate("Dialog", "ON", None, QtGui.QApplication.UnicodeUTF8))
        self.label_3.setText(QtGui.QApplication.translate("Dialog", "Monthly Cleanup :", None, QtGui.QApplication.UnicodeUTF8))
        self.label_9.setText(QtGui.QApplication.translate("Dialog", "OFF", None, QtGui.QApplication.UnicodeUTF8))
        self.label_12.setText(QtGui.QApplication.translate("Dialog", "ON", None, QtGui.QApplication.UnicodeUTF8))
        self.label_8.setText(QtGui.QApplication.translate("Dialog", "ON", None, QtGui.QApplication.UnicodeUTF8))
        self.label_11.setText(QtGui.QApplication.translate("Dialog", "OFF", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton.setText(QtGui.QApplication.translate("Dialog", "?", None, QtGui.QApplication.UnicodeUTF8))
        self.groupBox_3.setTitle(QtGui.QApplication.translate("Dialog", "Graphical User Interface", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton_3.setText(QtGui.QApplication.translate("Dialog", "?", None, QtGui.QApplication.UnicodeUTF8))
        self.label_14.setText(QtGui.QApplication.translate("Dialog", "Show Easy Backup Tool in the system tray :", None, QtGui.QApplication.UnicodeUTF8))
        self.label_16.setText(QtGui.QApplication.translate("Dialog", "OFF", None, QtGui.QApplication.UnicodeUTF8))
        self.label_15.setText(QtGui.QApplication.translate("Dialog", "ON", None, QtGui.QApplication.UnicodeUTF8))
        self.groupBox_4.setTitle(QtGui.QApplication.translate("Dialog", "GroupBox", None, QtGui.QApplication.UnicodeUTF8))
        self.label_20.setText(QtGui.QApplication.translate("Dialog", "Seconds", None, QtGui.QApplication.UnicodeUTF8))
        self.label_19.setText(QtGui.QApplication.translate("Dialog", "Backup Interval :", None, QtGui.QApplication.UnicodeUTF8))
        #self.timeEdit.setDisplayFormat(QtGui.QApplication.translate("Dialog", "HH:mm", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton_4.setText(QtGui.QApplication.translate("Dialog", "Apply", None, QtGui.QApplication.UnicodeUTF8))
        self.pushButton_5.setText(QtGui.QApplication.translate("Dialog", "Cancel", None, QtGui.QApplication.UnicodeUTF8))


def launch():
    import sys
    app = QtGui.QApplication(sys.argv)
    Dialog = QtGui.QDialog()
    ui = Ui_Dialog()
    ui.setupUi(Dialog)
    Dialog.show()
    sys.exit(app.exec_())

def setAll():
    defvalues= { 'OFF':'0', 'ON':'1' }
    ui.horizontalSlider_4.setValue(int(defvalues.get(userPref.getValue('SysTray'))))
    ui.horizontalSlider.setValue(int(defvalues.get(userPref.getValue('MCleanup'))))
    ui.horizontalSlider_2.setValue(int(defvalues.get(userPref.getValue('WCleanup'))))
    ui.horizontalSlider_3.setValue(int(defvalues.get(userPref.getValue('DCleanup'))))
    ui.horizontalSlider_5.setValue(int(defvalues.get(userPref.getValue('DiskCleanupAuto'))))
    ui.lineEdit.setText(userPref.getValue('DiskCleanupTreshold'))
    ui.lineEdit1.setText(userPref.getValue('BackupInterval'))
    
def setXml():
    defvalues= { 0:'OFF', 1:'ON' }
    #print defvalues1.get(ui.horizontalSlider_4.value())
    userPref.setValue('SysTray', str(defvalues.get(ui.horizontalSlider_4.value())))
    userPref.setValue('MCleanup', str(defvalues.get(ui.horizontalSlider.value())))
    userPref.setValue('WCleanup', str(defvalues.get(ui.horizontalSlider_2.value())))
    userPref.setValue('DCleanup', str(defvalues.get(ui.horizontalSlider_3.value())))
    userPref.setValue('DiskCleanupAuto', str(defvalues.get(ui.horizontalSlider_5.value())))
    userPref.setValue('DiskCleanupTreshold', str(ui.lineEdit.text()))
    userPref.setValue('BackupInterval', str(ui.lineEdit1.text()))
       
if __name__ == "__main__":
    import sys
    app = QtGui.QApplication(sys.argv)
    Dialog = QtGui.QDialog()
    ui = Ui_Dialog()
    ui.setupUi(Dialog)
    Dialog.show()
    setAll()
    app.connect(ui.pushButton_4,QtCore.SIGNAL("clicked()"),setXml)
    app.connect(ui.pushButton_5,QtCore.SIGNAL("clicked()"),Dialog.close)
    sys.exit(app.exec_())

